package com.sugar.psych.assessment.module.business.service.usertreeholechatrecord;

import java.util.*;
import javax.validation.*;
import com.sugar.psych.assessment.module.business.controller.admin.usertreeholechatrecord.vo.*;
import com.sugar.psych.assessment.module.business.controller.app.usertreeholechatrecord.vo.AiChatMessageReqVO;
import com.sugar.psych.assessment.module.business.controller.app.usertreeholechatrecord.vo.AiChatMessageRespVO;
import com.sugar.psych.assessment.module.business.controller.app.usertreeholechatrecord.vo.AiChatRecordSimpleRespVO;
import com.sugar.psych.assessment.module.business.dal.dataobject.usertreeholechatrecord.UserTreeHoleChatDO;
import com.sugar.psych.assessment.module.business.dal.dataobject.usertreeholechatrecord.UserTreeHoleChatRecordDO;
import com.sugar.psych.assessment.framework.common.pojo.PageResult;
import com.sugar.psych.assessment.framework.common.pojo.PageParam;

/**
 * 树洞AI聊天会话 Service 接口
 *
 * @author Ysugar
 */
public interface UserTreeHoleChatRecordService {

    /**
     * 创建树洞AI聊天会话
     *
     * @param createReqVO 创建信息
     * @return 编号
     */
    Long createUserTreeHoleChatRecord(@Valid UserTreeHoleChatRecordSaveReqVO createReqVO);

    /**
     * 更新树洞AI聊天会话
     *
     * @param updateReqVO 更新信息
     */
    void updateUserTreeHoleChatRecord(@Valid UserTreeHoleChatRecordSaveReqVO updateReqVO);

    /**
     * 删除树洞AI聊天会话
     *
     * @param id 编号
     */
    void deleteUserTreeHoleChatRecord(Long id);

    /**
    * 批量删除树洞AI聊天会话
    *
    * @param ids 编号
    */
    void deleteUserTreeHoleChatRecordListByIds(List<Long> ids);

    /**
     * 获得树洞AI聊天会话
     *
     * @param id 编号
     * @return 树洞AI聊天会话
     */
    UserTreeHoleChatRecordDO getUserTreeHoleChatRecord(Long id);

    /**
     * 获得树洞AI聊天会话分页
     *
     * @param pageReqVO 分页查询
     * @return 树洞AI聊天会话分页
     */
    PageResult<UserTreeHoleChatRecordDO> getUserTreeHoleChatRecordPage(UserTreeHoleChatRecordPageReqVO pageReqVO);

    // ==================== 子表（树洞AI聊天消息） ====================

    /**
     * 获得树洞AI聊天消息分页
     *
     * @param pageReqVO 分页查询
     * @param recordId 记录ID
     * @return 树洞AI聊天消息分页
     */
    PageResult<UserTreeHoleChatDO> getUserTreeHoleChatPage(PageParam pageReqVO, Long recordId);

    /**
     * 创建树洞AI聊天消息
     *
     * @param userTreeHoleChat 创建信息
     * @return 编号
     */
    Long createUserTreeHoleChat(@Valid UserTreeHoleChatDO userTreeHoleChat);

    /**
     * 更新树洞AI聊天消息
     *
     * @param userTreeHoleChat 更新信息
     */
    void updateUserTreeHoleChat(@Valid UserTreeHoleChatDO userTreeHoleChat);

    /**
     * 删除树洞AI聊天消息
     *
     * @param id 编号
     */
    void deleteUserTreeHoleChat(Long id);

    /**
    * 批量删除树洞AI聊天消息
    *
    * @param ids 编号
    */
    void deleteUserTreeHoleChatListByIds(List<Long> ids);

	/**
	 * 获得树洞AI聊天消息
	 *
	 * @param id 编号
     * @return 树洞AI聊天消息
	 */
    UserTreeHoleChatDO getUserTreeHoleChat(Long id);

    Long createAiChatRecord(Long loginUserId);

    void sendChatMessageStream(AiChatMessageReqVO sendReqVO, Long loginUserId);

    List<AiChatMessageRespVO> getAiChatRecord(Long id);

    PageResult<AiChatRecordSimpleRespVO> appGetAiChatRecordPage(PageParam pageParam, Long loginUserId);

    void delAiChatRecord(Long loginUserId, Long id);
}